home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 12857 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1021 b   |  44 lines

  1. Newsgroups: comp.lang.c
  2. Path: news.inap.net!news1!ind-008-237-73
  3. From: dlmiller@iquest.net (Doug Miller)
  4. Subject: Re: Why does my program do this?
  5. X-Nntp-Posting-Host: ind-008-237-73.iquest.net
  6. Message-ID: <Dp9A9p.K60@iquest.net>
  7. Sender: news@iquest.net (News Admin)
  8. Organization: IQuest Network Services
  9. X-Newsreader: News Xpress Version 1.0 Beta #2.1
  10. References: <4jnln2$95j@dfw-ixnews3.ix.netcom.com> <4jpe4s$db2@penage.cs.laurentian.ca>
  11. Date: Tue, 2 Apr 1996 22:27:26 GMT
  12.  
  13. echan@nickel.laurentian.ca (Edward C. Chan) wrote:
  14. >>char scores[STUDENT][5];
  15. >>
  16. >>    for (i=0; i <= students-1; i=i+1)
  17. >>        {
  18. >>            for (j=0; j <= tests-1; j=j+1)
  19. >>            {
  20. >>                gets(&scores[i][j]);
  21. >>            }
  22. >>        }
  23. >>
  24. >
  25. >user error.
  26. >
  27. >replace
  28. >
  29. >   gets(&scores[i][j]);
  30. >
  31. >with
  32. >
  33. >   gets(scores[i][j]);
  34. >
  35. >andeverything shall work fine.
  36.  
  37. I would be surprised if that is the case.  Consider the definition of scores...
  38.  
  39.  Actually, you are lucky that the programme
  40. >doesn't crash on you.
  41.  
  42. Agreed.
  43.  
  44.